<?php

// +----------------------------------------------------------------------
// |首页管理控制器
// +----------------------------------------------------------------------
namespace app\admin\controller;

use app\BaseController;
use think\facade\View;
use think\facade\Session;
use think\facade\Config;
use app\admin\Model\MenuModel;
use app\common\system\IndexService;
class Index extends BaseController
{
    public function index()
    { 
       
     $IndexService=new IndexService();     
       $user= session('user');      
       $group= session('group');//获取缓存中的用户组信息     
        if(request()->isPost()){
            $param = request()->post();
            $param['params'] = $group;
            $data= IndexService::index($param);        
            success($data);
        }else{        
            View::assign('nickname',$user['nickname']??"游客");
            return View();
        }
    }

    public function home()
    {
        return view('home');
    }
}
